package com.hxgis.flow.controller;

import com.hxgis.flow.flow.InitFlow;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 流程执行
 */
@Api("初始化流程")
@RestController
public class InitFlowController {

    @Autowired
    private InitFlow initFlow;

    @GetMapping(value = "/getRainfallData")
    @ApiOperation(value = "初始化")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "startTime",value = "开始时间",example="20200101"),
            @ApiImplicitParam(name = "endTime",value = "结束时间",example="20200709")
    })
    public void getRainfallData(@RequestParam String startTime,
                                @RequestParam String endTime){

        initFlow.start(startTime, endTime, 500);
    }
}
